import request from '@/utils/request'

export function get(params) {
  return request({
    url: '/portal/message/page',
    method: 'get',
    params
  })
}

export function getHistory(params) {
  return request({
    url: '/portal/message-log/page',
    method: 'get',
    params
  })
}

export function del(id) {
  return request({
    url: `/portal/message/${id}`,
    method: 'delete'
  })
}

export function add(data) {
  return request({
    url: `/portal/message`,
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: `/portal/message`,
    method: 'put',
    data
  })
}

export function changeStatus(data) {
  return request({
    url: `/portal/message/send`,
    method: 'put',
    data
  })
}

export function getCode(params) {
  return request({
    url: '/portal/message',
    method: 'get',
    params
  })
}
